export  function tableDataDoubleCol(data){
  let arry=[],ids=[]
  if (!data || !data.length) {
    return data
  }
  data.forEach(item=>{
    if (item.charges && item.charges.goodsServices && item.charges.goodsServices.length){
      for (let i=0;i<item.charges.goodsServices.length;i++) {
        if ((i+1)%2 == 0) {
          ids.push(item.charges.goodsServices[i].id)
          let obj={}
          for (let j in item.charges.goodsServices[i]) {
            obj[j+"1"] = item.charges.goodsServices[i][j];
          }
          // arry.push(obj);
          if (i-1>=0){
            for (let o in obj) {
              item.charges.goodsServices[i-1][o] = obj[o]
            }
          }
        }
      }
      /*添加删除*/
      ids.forEach(id=>{
        item.charges.goodsServices.forEach((n,index)=>{
          if (n.id == id){
            item.charges.goodsServices.splice(index,1)
          }
        })
      })
    }
  })
  return data
}
export  function tableDataDoubleColArry(data){
  let arry=[],ids=[]
  if (!data || !data.length) {
    return data
  }
      for (let i=0;i<data.length;i++) {
        if ((i+1)%2 == 0) {
          ids.push(data[i].id)
          let obj={}
          for (let j in data[i]) {
            obj[j+"1"] = data[i][j];
          }
          // arry.push(obj);
          if (i-1>=0){
            for (let o in obj) {
              data[i-1][o] = obj[o]
            }
          }
        }
      }
      /*添加删除*/
      ids.forEach(id=>{
        data.forEach((n,index)=>{
          if (n.id == id){
            data.splice(index,1)
          }
        })
      })

  return data
}
